const $sql = require('../sqlfun');//sql语句
var models = require('../connectmysql');//数据库链接信息
var mysql = require('mysql');
var conn = mysql.createConnection(models.mysql);
conn.connect();
module.exports=(req, res) => {
  var sql = $sql.user.updataMsg;
  var params = req.body.upMsg;
  console.log("sql",sql);
  console.log("params",params);
  conn.query(sql, [params.tel,params.age,params.sex,params.introduce,params.name], function(err, data) {
    if(err){
      var result={
        "status":"500",
        "message":"服务器错误"
      }
      console.log(result+err);
      res.send(result);
    }
    else {
      var result={
        "status":"200",
        "message":"success",
        data:data
      }
      console.log(result);
      res.send(result);
    }
  })
}
